\documentclass{beamer}
\setbeamercovered{transparent}
\usetheme{Warsaw}
%\logo{\includegraphics[height=0.5cm]{logo.png}}
\usecolortheme{seahorse}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{geometry}
% \usepackage{floatflt}
\usepackage{float}
\usepackage{url}
\usepackage{hyperref}
\usepackage{subfigure}
\usepackage{listings}
\usepackage{caption} \lstset{numberstyle=\tiny, numbersep=5pt}
%\usepackage[colorlinks,urlcolor=blue,linkcolor=blue,citecolor=red]{hyperref}
\usepackage{color}
%enable / disable notes
\setbeameroption{show notes}

%define full screen images
\newenvironment{changemargin}[2]{%
\begin{list}{}{%
\setlength{\topsep}{0pt}%
\setlength{\leftmargin}{#1}%
\setlength{\rightmargin}{#2}%
\setlength{\listparindent}{\parindent}%
\setlength{\itemindent}{\parindent}%
\setlength{\parsep}{\parskip}%
}%
\item[]}{\end{list}}


% Make one image take up the entire slide content area in beamer,.:
% centered/centred full-screen image, with title:
% This uses the whole screen except for the 1cm border around it
% all. 128x96mm
\newcommand{\titledFrameImage}[2]{
\begin{frame}{#1}
%\begin{changemargin}{-1cm}{-1cm}
\begin{center}
\includegraphics[width=108mm,height=\textheight,keepaspectratio]{#2}
\end{center}
%\end{changemargin}
\end{frame}
}

% Make one image take up the entire slide content area in beamer.:
% centered/centred full-screen image, no title:
% This uses the whole screen except for the 1cm border around it
% all. 128x96mm
\newcommand{\plainFrameImage}[1]{
\begin{frame}[plain]
%\begin{changemargin}{-1cm}{-1cm}
\begin{center}
\includegraphics[width=108mm,height=76mm,keepaspectratio]{#1}
\end{center}
%\end{changemargin}
\end{frame}
}

% Make one image take up the entire slide area, including borders, in
% centered/centred full-screen image, no title:
% This uses the entire whole screen
\newcommand{\maxFrameImage}[1]{
\begin{frame}[plain]
\begin{changemargin}{-1cm}{-1cm}
\begin{center}
\includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]
{#1}
\end{center}
\end{changemargin}
\end{frame}
}




\definecolor{lightgray}{rgb}{0.8,0.8,0.8}
\definecolor{violet}{rgb}{0.5,0.21,0.56}
\definecolor{darkgreen}{rgb}{0.0,0.5,0.0}
\definecolor{red}{rgb}{1.0,0.0,0.0}
\definecolor{blue}{rgb}{0.0,0.0,1.0}

\lstset{%
  language=Java,
  keywordstyle=\color{blue}, 
  breaklines=true,
  frame=none,
  commentstyle=\color{darkgreen},
  backgroundcolor=\color{lightgray},
  stringstyle=\color{violet},
  basicstyle=\scriptsize\ttfamily,       % the size of the fonts that are used for the code
  numbers=left,                   % where to put the line-numbers
  numberstyle=\tiny,      % the size of the fonts that are used for the line-numbers
  stepnumber=1,                   % the step between two line-numbers. If it is 1 each line will be numbered
  numbersep=5pt,                  % how far the line-numbers are from the code
  showspaces=false,               % show spaces adding particular underscores
  showstringspaces=false,         % underline spaces within strings
  showtabs=false,                 % show tabs within strings adding particular underscores
  tabsize=2,              % sets default tabsize to 2 spaces
  captionpos=b,                   % sets the caption-position to bottom
  breaklines=true,        % sets automatic line breaking
  breakatwhitespace=false,    % sets if automatic breaks should only happen at whitespace
  escapeinside={\%}{)}          % if you want to add a comment within your code
}%

\setbeamertemplate{blocks}[rounded][shadow=true] 

\title{Let's do stuff together}
\subtitle{Masterseminar} 

\titlegraphic{\includegraphics[width=12mm]{logo}}
\author{Christoph Fuchs and Stefan Thaler}
\date{\today}
\begin{document}

\frame{\titlepage}
% 
\section{Features we implemented}
\begin{frame}
\begin{block}{Android App Features}
	\begin{itemize}
		\item Create and share new activities
		\item Discover local activities
		\item Use places of interest as locations
     \end{itemize}
\end{block}
\vspace{0.3em}
\begin{block} {Server Features}
	\begin{itemize}
		\item OpenID authentication
		\item Data persistence in RDF
		\item REST interface
		\item Search activities within range
     \end{itemize}
\end{block}
\end{frame}

\section{Libraries we used}
\begin{frame}{Activity Server}
\begin{block} {Tools}
	\begin{itemize}
      \item Apache Tomcat 6.0
      \item Eclipse WTP
      \item Maven 2
      \item JDK 1.6
     \end{itemize}
\end{block}
\end {frame}

\begin{frame}{Activity Server cont'd}
\begin{block} {Libraries}
	\begin{itemize}
      \item Project Lombok 0.9.2
      \item Alibaba Object Repository 2.0 alpha RC4
      \item Sesame Repository 2.3.1
      \item Gson 1.4
      \item Openid4java 0.9.5
      \item Log4J 1.2.16
      \item JUnit 4.8.1
    \end{itemize}
\end{block}
\end{frame}
\begin{frame}{Android App}
\begin{block} {Tools}
	\begin{itemize}
      \item Eclipse with ADT plugin.
      \item Android SDK.
     \end{itemize}
\end{block}
\vspace{0.2em}
\begin{block} {Libraries}
	\begin{itemize}
     \item Android API 2.1 Level 7
     \item Google API Level 7
     \item Gson 1.4
    \end{itemize}
\end{block}
\end{frame}

\section{Difficulties we ran into}

\begin{frame}
\begin{block} {Pitfalls}
	\begin{itemize}
      \item Restlet API is too complex for our project scale
      \item Alibaba object proxies don't comply with Gson
      \item Project Lombok doesn't work with Android
      \item Android libraries don't work outside of the Android environment
      \item Developer machine's localhost is 10.0.2.2 in Android simulator
      \item Geo coding does not work with Android 2.2
     \end{itemize}
\end{block}
\end{frame}
\section{What could we do}
\begin{frame}
\begin{block} {Future features}
	\begin{itemize}
      \item Extend search (e.g. search for activity name, categories, person
      etc.).
      \item Integrate with social platforms (push, pull)
      \item Add communication possibilities
      \item Support any OpenID provider
     \end{itemize}
\end{block}

\end{frame}

\section{Introducing the App}

\subsection{REST Interface}
\frame{
\begin{block} {Manage Activities - /activity/}
	\begin{itemize}
      \item Create Activity(POST): title, description, lat, long, alt,
      startTime, endTime
      \item Read Activity(GET): id
      \item Update Activity(PUT):  id, parameters to update
      \item Delete Activity(DELETE): id
     \end{itemize}
\end{block}

\begin{block} {Authentication - /auth/ and /auth/authenticated/}
	\begin{itemize}
      \item OpenID authentication(GET): openIdUrl
      \item Is authenticated(GET): openIdUrl
     \end{itemize}
\end{block}

}
\frame{
\begin{block} {Search Activities - /activity/search/}
	\begin{itemize}
        \item Required parameters: long, lat, alt, range
        \item Optional parameters: categories, startTime,endTime
     \end{itemize}
\end{block}


}

\subsection{Coordinate Calculations}
\frame{
	\begin{block} {Spatial bounding box}
    	\begin{itemize}
          \item Android API delivers coordinates as LLA (Longitude Latitude
          Altitude) - coordinates
          \item Distance calculations are not feasible using SPARQL
          \item Solution approach: convert LLA to ECEF (Earth Centered Earth
          Fixed) coordinates
          \item Calculate 3D bounding box
        \end{itemize}
	\end{block}
}

\subsection{RDF Storage and Querying}
\frame{
\begin{block} {Alibaba storage}
	\begin{itemize}
        \item Saves Java Objects as RDF
        \item Uses Java Annotation API
        \item Based on Sesame RDF repository
     \end{itemize}
\end{block}
}

\frame[containsverbatim]{
\tiny
\begin{block} {Search RDF Data - example query}
\begin{verbatim}
SELECT ?activities
WHERE {
  ?activities as:hasX ?x.
  ?activities as:hasY ?y.
  ?activities as:hasZ ?z.
  ?activities as:hasStartTime ?starttime.
  ?activities as:hasTitle ?title.
  FILTER ( 
    (?starttime >= ?currentTime) && 
    ( (?x < (?currentX + ?halfRange)) 
      && (?x > (?currentX - ?halfRange)) 
      && (?y < (?currentY + ?halfRange)) 
      && (?y > (?currentY - ?halfRange)) 
      && (?z < (?currentZ + ?halfRange)) 
      && (?z > (?currentZ - ?halfRange))
    )) 
}
\end{verbatim}
\end{block}
}




\begin{frame}
\begin{block} {What do we present?}
	\begin{itemize}
      \item Start the Tomcat Server
      \item Start the Android App
      \item Login via OpenID
      \item Create an activity
      \item Simulate a position change
      \item Find activities
     \end{itemize}
\end{block}
\end{frame}

\section{Demo}


\begin{frame}
	\begin{center}
		\bfseries \huge It's showtime
	\end{center}
\end{frame}


 %start tomcat

\begin{frame}{Something went wrong\ldots}
	\begin{center}
		\bfseries \huge Start the ActivityServer
	\end{center}
\end{frame}
\maxFrameImage{screenshots/Bildschirmfoto-RunConfigurations-tomcat.png}
%start android app

\begin{frame}
	\begin{center}
		\bfseries \huge Start the Android App
	\end{center}
\end{frame}
\maxFrameImage{screenshots/Bildschirmfoto-RunConfigurations.png}
%login via open id

\begin{frame}
	\begin{center}
		\bfseries \huge Login via OpenID
	\end{center}
\end{frame}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-1.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-3.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-4.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-5.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-6.png}

%create activity

\begin{frame}
	\begin{center}
		\bfseries \huge Create an activity
	\end{center}
\end{frame}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-7.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-8.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-9.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-10.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-11.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-12.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-13.png}
%simulate a position change

\begin{frame}
	\begin{center}
		\bfseries \huge Simulate a location change
	\end{center}
\end{frame}
\maxFrameImage{screenshots/Bildschirmfoto-Terminal.png}
\maxFrameImage{screenshots/Bildschirmfoto-Terminal-1.png}
\maxFrameImage{screenshots/Bildschirmfoto-Terminal-2.png}
%find activity

\begin{frame}
	\begin{center}
		\bfseries \huge Find an activity
	\end{center}
\end{frame}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-14.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-15.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-16.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-17.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-18.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-19.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-20.png}
\maxFrameImage{screenshots/Bildschirmfoto-5554:GoogleApiLvl7-21.png}



%\frame{%bibliogrpahy
%  \tiny{
%  \nocite{*}
%  \bibliographystyle{splncs}
%  \bibliography{llncs_qe}}
%}

% 
\end{document}